package com.bidepan.big_event.validation;

import com.bidepan.big_event.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;

public class StateValidation implements ConstraintValidator<State,String> {

    /**
     *
     * @param value 将来要校验的数据
     * @param Context
     * @return
     */
    @Override
    public boolean isValid(String value, ConstraintValidatorContext Context) {
        //提供校验规则
        return value.equals("已发布") || value.equals("草稿");
    }
}
